<template>
  <div>
    <h3>I am Header</h3>
    <h1>{{ title }}</h1>
    <span @click="setValue">set</span>
    <button @click="showMsg">msg</button>
  </div>
</template>

<script>
export default {
  emits: ["update:title", "showLog"],
  //    {
  //     // showLog: null,
  //     'update:title':()=>{}
  //   },
  props: {
    title: {
      type: String,
    },
  },
  methods: {
    showMsg() {
      this.$emit("showLog", "hello");
    },
    setValue() {
      this.$emit("update:title", "我成了修改后的标题");
    },
  },
};
</script>

<style lang="less" scoped>
</style>